﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace IceDog.EFCore.Cmd.OfficalDemo.Models
{
    //from:https://docs.microsoft.com/zh-cn/ef/core/
    /// <summary>
    /// 博客
    /// </summary>
    public class Blog
    {
        /// <summary>
        /// 博客id
        /// </summary>
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]//主键，自动递增
        public int BlogId { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 评分
        /// </summary>
        public int Rating { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 评论
        /// </summary>
        public List<Post> Posts { get; set; }
    }
}
